﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SharppiFlowEditor.views
{
    public class NewDocumentView : Form
    {
        private Button okButton;
        private Button cancelButton;
        private Label text;
        private Label widthLabel;
        private TextBox widthTextBox;
        private Label heightLabel;
        private TextBox heightTextBox;

        public Int32 DiagramHeight
        {
            get { return Convert.ToInt32(heightTextBox.Text); }
        }

        public Int32 DiagramWidth
        {
            get { return Convert.ToInt32(widthTextBox.Text); }
        }


        public NewDocumentView()
        {
            this.MinimumSize = new System.Drawing.Size(300, 200);
            this.AutoSize = true;
            this.Text = "Create new document";
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            okButton = new Button();
            okButton.Text = "Ok";
            okButton.Name = "Ok";
            okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
            okButton.Location = new System.Drawing.Point(180, 130);
            cancelButton = new Button();
            cancelButton.Text = "Cancel";
            cancelButton.Name = "Cancel";
            cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            cancelButton.Location = new System.Drawing.Point(260, 130);
            
            text = new Label();
            text.Text = "Define the size of the document.";
            text.Width = 350;
            text.Location = new System.Drawing.Point(10, 10);

            widthLabel = new Label();
            widthLabel.Text = "Width:";
            widthLabel.Location = new System.Drawing.Point(25, 50);
            widthLabel.Width = 50;
            widthTextBox = new TextBox();
            widthTextBox.Text = "640";
            widthTextBox.Name = "widthTextBox";
            widthTextBox.Location = new System.Drawing.Point(80, 50);

            heightLabel = new Label();
            heightLabel.Text = "Height:";
            heightLabel.Location = new System.Drawing.Point(25, 75);
            heightLabel.Width = 50;
            heightTextBox = new TextBox();
            heightTextBox.Text = "480";
            heightTextBox.Name = "heightTextBox";
            heightTextBox.Location = new System.Drawing.Point(80, 75);

            Controls.AddRange(new Control[] { text, widthLabel, widthTextBox, heightLabel, heightTextBox, okButton, cancelButton });

           /* tableLayoutPanel = new TableLayoutPanel();
            tableLayoutPanel.ColumnCount = 1;
            tableLayoutPanel.RowCount = 2;
            tableLayoutPanel.Size = new System.Drawing.Size(300, 500);

            innerTableLayoutPanel = new TableLayoutPanel();
            innerTableLayoutPanel.ColumnCount = 4;
            innerTableLayoutPanel.RowCount = 6;

            tableLayoutPanel.Controls.Add(text, 0, 0);
            tableLayoutPanel.Controls.Add(innerTableLayoutPanel, 0, 1);

            innerTableLayoutPanel.Controls.Add(heightLabel, 1, 2);
            innerTableLayoutPanel.Controls.Add(heightTextBox, 2, 2);
            innerTableLayoutPanel.Controls.Add(widthLabel, 1, 3);
            innerTableLayoutPanel.Controls.Add(widthTextBox, 2, 3);
            innerTableLayoutPanel.Controls.Add(okButton, 2, 5);
            innerTableLayoutPanel.Controls.Add(cancelButton, 3, 5);

            this.Controls.Add(tableLayoutPanel);
            */
            
        }

    }
}
